//
//  HotImageLabel.m
//  CarWorld
//
//  Created by yuyu on 15/3/31.
//  Copyright (c) 2015年 CarWorldTeam. All rights reserved.
//

#import "HotImageLabel.h"

@implementation HotImageLabel
- (void)dealloc
{
    [_image_View release];
    [_nameLbl release];
    [_priceLbl release];
    [_refPriceLbl release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self=[super initWithFrame:frame]) {
        
        CGFloat imageViewWidth = (frame.size.width-20)*0.4;
        CGFloat pHeight = frame.size.height-10;
        _image_View = [[UIImageView alloc] initWithFrame:CGRectMake(10, 5, imageViewWidth, pHeight)];
        
        [self addSubview:_image_View];
        
        CGFloat Width = frame.size.width - imageViewWidth - 10;
        CGFloat Height = (pHeight-5)/3.0;
        CGFloat y=5;
        _nameLbl = [[UILabel alloc] initWithFrame:CGRectMake(10+5+imageViewWidth, y, Width, Height)];
        [self addSubview:_nameLbl];
        y += Height + 5;
        _priceLbl = [[UILabel alloc] initWithFrame:CGRectMake(10+5+imageViewWidth, y, Width, Height)];
        _priceLbl.font = [UIFont systemFontOfSize:12];
        [self addSubview:_priceLbl];
        
        y += Height + 5;
        _refPriceLbl = [[UILabel alloc] initWithFrame:CGRectMake(10+5+imageViewWidth, y, Width, Height)];
        _refPriceLbl.font = [UIFont systemFontOfSize:12];
        [self addSubview:_refPriceLbl];
    }
    return self;
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
